<template>
  <div class="app-container">
    <el-form class="formList" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px"
      @keyup.enter.native="handleQuery">
      <el-row>

        <el-form-item label="论文分类" prop="categoryUid">
          <el-select v-model="queryParams.categoryUid" placeholder="请选择论文分类" style="width: 232px;" clearable size="small" @change="changeCategory"
            class="input-rule">
            <el-option v-for="brand in brandOptions" :key="brand.groupUid" :label="brand.groupName"
              :value="brand.groupUid" />
          </el-select>
        </el-form-item>
        <el-form-item label="论文专业" prop="majorUids">
          <el-cascader :props="{ checkStrictly: true }" v-model="queryParams.majors" :options="categoryOptions"
            style="width: 232px;" clearable filterable size="small" class="input-rule">
          </el-cascader>
        </el-form-item>
      </el-row>
      <el-row>
        <el-form-item label="论文编号" prop="productNo">
          <el-input v-model="queryParams.productNo" placeholder="请输入论文编号" style="width: 232px;" clearable size="small"
            class="input-rule" />
        </el-form-item>
        <el-form-item label="论文标题" prop="productName">
          <el-input v-model="queryParams.productName" placeholder="请输入论文标题" style="width: 232px;" clearable size="small"
            class="input-rule" />
        </el-form-item>
        <el-form-item label="论文标签">
          <el-select v-model="queryParams.tagsUid" placeholder="请选择标签" clearable multiple style="width:232px;">
            <el-option v-for="tags in tagsOptions" :key="tags.tagsUid" :label="tags.tagsName" :value="tags.tagsUid" />
          </el-select>
        </el-form-item>
      </el-row>
      <el-row>
        <el-form-item label="排序字段">
          <el-select v-model="queryParams.sortProperty" placeholder="请选择排序字段" clearable style="width:232px;">
            <el-option value="updateTime" label="修改时间">修改时间</el-option>
            <el-option value="productNo" label="论文编号">论文编号</el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="排序方式">
          <el-select v-model="queryParams.sortType" placeholder="请选择排序方式" clearable style="width:232px;">
            <el-option value="desc" label="降序">降序</el-option>
            <el-option value="asc" label="升序"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="margin-left: 22px;">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-row>
    </el-form>
    <el-row class="row-mbinfo" style="margin-left: 0px; margin-right: 0px;">
      <el-button-group style="width: 600px;">
        <el-button :class="activeClass == 0 ? 'button-sku-blue':''" @click="handleQueryStatus(0)" size="small">
          <svg-icon icon-class="product_info_all" />
          <span style="margin-left: 14%;">全部</span>
        </el-button>
        <el-button :class="activeClass == 1 ? 'button-sku-blue':''" @click="handleQueryStatus(1)" size="small">
          <svg-icon icon-class="product_info_sale" />
          <span style="margin-left: 14%;">已上架</span>
        </el-button>
        <el-button :class="activeClass == 3 ? 'button-sku-blue':''" @click="handleQueryStatus(3)" size="small">
          <svg-icon icon-class="product_info_soldOut" />
          <span style="margin-left: 14%;">已下架</span>
        </el-button>
      </el-button-group>
      <el-button type="primary" plain icon="el-icon-plus" size="small" @click="handleAdd"
        v-hasPermi="['product:info:add']">新增
      </el-button>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <div class="divTable">
      <el-table class="el-table" v-loading="loading" :data="infoList" @selection-change="handleSelectionChange" border>
        <el-table-column label="论文编号" align="center" prop="productNo" width="100">
        </el-table-column>
        <el-table-column label="论文标题" align="left" prop="productName" min-width="180" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column label="论文分类" align="center" prop="categoryName" width="140" :show-overflow-tooltip="true"/>
        <el-table-column label="一级专业" align="center" prop="majorUidOneName" width="140" :show-overflow-tooltip="true"/>
        <el-table-column label="二级专业" align="center" prop="majorUidTwoName" width="140" :show-overflow-tooltip="true" />
        <el-table-column label="积分" align="center" prop="jifen"  width="60" />
        <el-table-column label="字数" align="center" prop="numbers"  width="90" :show-overflow-tooltip="true"/>
        <el-table-column label="下载量" align="center" prop="downloadCount"  width="60" />
        <el-table-column label="买断量" align="center" prop="buyCount" width="60" />
        <el-table-column label="更新时间" align="center" prop="updateTime" width="200" :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
            <span>{{ statusFormat(scope.row.dataStatus) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center"  class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button size="mini" type="text" icon="el-icon-edit"
              @click="handleUpdate(scope.row)" v-hasPermi="['product:info:edit']">修改
            </el-button>
            <el-button
              v-if=" scope.row.dataStatus == 0"
              size="mini" type="text" icon="el-icon-arrow-up" @click="handleSaveLog(1,null,null,0, scope.row)">上架
            </el-button>
            <el-button
              v-if=" scope.row.dataStatus == 1"
              size="mini" type="text" icon="el-icon-arrow-down" @click="handleSaveLog(0,null,null,0, scope.row)">下架
            </el-button>
            <el-button v-if="scope.row.dataStatus == 0 " size="mini" type="text"
              icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['product:info:remove']">删除
            </el-button>
            <el-button size="mini" type="text" icon="el-icon-notebook-1" @click="clickLog(scope.row)">查看日志
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList" />
    </div>
    <el-dialog :title="title" :visible.sync="openLunwen" width="1100px"  append-to-body>
      <el-form ref="form"
        :model="form"
        :rules="rules"
        label-width="140px"
        label-position="right">
        <div class="product-div">
          <div class="product-header">
            <em style="font-size: 18px;font-style: normal;"
              class="big_title_style">基本信息</em>
          </div>
          <el-row :gutter="24">
            <el-col :span="21">
              <el-form-item label="论文标题"
                prop="productName">
                <el-input v-model="form.productName"
                  placeholder="请输入论文标题"
                  clearable
                  maxlength="200"
                  show-word-limit />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="7">
              <el-form-item label="论文类别"
                prop="categoryUid">
                <el-select v-model="form.categoryUid"
                  placeholder="请选择类别"
                  @change="changeMajor"
                  clearable>
                  <el-option v-for="unit in inputLunwWenGroupOptions"
                    :key="unit.groupUid"
                    :label="unit.groupName"
                    :value="unit.groupUid" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="14">
              <el-form-item label="论文专业"
                prop="majorUids"
                style="width: 100%;">
                <el-cascader style="width: 100%;"
                  v-model="form.majorUids"
                  :options="inputCategoryOptions"
                  clearable
                  filterable>
                </el-cascader>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="7">
              <el-form-item label="论文编码"
                prop="productNo">
                <el-input v-model="form.productNo"
                  placeholder="请输入论文编码"
                  clearable
                  />
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="论文页数"
                prop="pages">
                <el-input v-model="form.pages"
                  placeholder="请输入论文页数"
                  clearable
                  maxlength="3"
                  @input="form.pages=form.pages.replace(/^(0+)|[^\d]+/g, '')"
                  show-word-limit />
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="论文字数"
                prop="numbers">
                <el-input v-model="form.numbers"
                  placeholder="请输入论文字数"
                  clearable
                  @input="form.numbers=form.numbers.replace(/^(0+)|[^\d]+/g, '')"
                  maxlength="6"
                  show-word-limit>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="7">
              <el-form-item label="下载积分"
                prop="jifen">
                <el-input v-model="form.jifen"
                  placeholder="请输入下载积分"
                  clearable
                  maxlength="5"
                  @input="form.jifen=form.jifen.replace(/^(0+)|[^\d]+/g, '')"
                  show-word-limit />
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="买断积分"
                prop="costPrice">
                <el-input v-model="form.costPrice"
                  placeholder="请输入买断积分"
                  clearable
                  maxlength="5"
                  @input="form.costPrice=form.costPrice.replace(/^(0+)|[^\d]+/g, '')"
                  show-word-limit />
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="应用类型"
                prop="lunwenType">
                <el-select v-model="form.lunwenType"
                  placeholder="请选择品牌"
                  clearable>
                  <el-option v-for="dict in paperTypes" :key="dict.dictValue" :label="dict.dictLabel"
                      :value="dict.dictValue" />
                  </el-select>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="24">
            <el-col :span="7">
              <el-form-item label="可过传统查重"
                prop="isTraditionDuplicate">
                <el-checkbox v-model="form.isTraditionDuplicate"></el-checkbox>
              </el-form-item>
            </el-col>
            <el-col :span="7">
             <el-form-item label="可过AIGC查重"
               prop="isTraditionDuplicate">
               <el-checkbox v-model="form.isAigcDuplicate"></el-checkbox>
             </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="24">
            <el-col :span="21">
              <el-form-item label="论文标签"
                prop="tagsUid"
                style="width: 100%;">
                <el-select v-model="form.tagsUid"
                  placeholder="请选择标签"
                  clearable
                  multiple
                  style="width: 100%;">
                  <el-option v-for="tags in tagsOptions"
                    :key="tags.tagsUid"
                    :label="tags.tagsName"
                    :value="tags.tagsUid" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="展示文件"
              prop="showFile">
              <uploadFile :imageStr.sync="form.showFile"
                :size="200 * 1024 * 1024"
                :key="form.showFile"
                :msg="'文件要求：大小200M内。'"
                :limit="1"
                ref="childss">
              </uploadFile>
            </el-form-item>
          <el-form-item label="下载文件"
            prop="downloadFile">
            <uploadFile :imageStr.sync="form.downloadFile"
              :key="form.downloadFile"
              ref="childs"
              :msg="'文件要求：大小200M内。'"
              :limit="1"
              :size="200 * 1024 * 1024"></uploadFile>
          </el-form-item>
        </div>
      </el-form>
      <div class="dw">
        <el-button @click="backPro"
          style="margin-top: 10px;margin-left: 40%;">返回</el-button>
        <el-button type="primary" @click="submitForm"  style="margin-top: 10px;">保存</el-button>
      </div>
    </el-dialog>

    <el-dialog title="操作日志" :visible.sync="openLog" width="1000px" append-to-body :destroy-on-close="true"
      @close="halog">
      <div>
        <el-table :data="logLists" border max-height="500">
          <el-table-column label="论文标题" align="center" prop="productName" />
          <el-table-column label="操作类型" align="center" prop="valuesDesc" width="90" :formatter="typeFormat" />
          <el-table-column label="操作内容" align="center" prop="detailInfo" width="300" />
          <el-table-column label="创建人" align="center" prop="createName" width="80" />
          <el-table-column label="创建时间" align="center" prop="createTime" width="180" sortable>
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total>0" :total="totals" :page.sync="queryParamss.pageNum"
          :limit.sync="queryParamss.pageSize" @pagination="getLogList" />
      </div>
    </el-dialog>
  </div>
</template>

<script>

  import {
    listInfo,
    getInfo,
    delInfo,
    addInfo,
    updateInfo,
    getInfoDetail,
    getInfoDetailEdit,
    editSaveLog,
    getLog,
  } from "@/api/product/info";
  import {
    selectOptions
  } from "@/api/product/category";
  import {
    bulidBrandSelect
  } from "@/api/product/brand";
  import {
    bulidTagsSelect
  } from "@/api/product/tags";
  import { firstGroupList} from "@/api/product/group";
  import uploadFile from "@/components/ImageUpload/uploadFile";
  export default {
    name: "Info",
    components: {
      uploadFile
    },
    data() {
      return {
        fullscreenLoading: false,
        checkedCities: [],
        //cities: ['上海', '北京', '广州', '深圳'],
        openCategory: false,
        batch: "",
        appletImg: null,
        h5Img: null,
        h5Span: null,
        tagsOptions: [],
        indexMethod: 1,
        openMe: false,
        logLists: [],
        openLog: false,
        openLunwen:false,
        detailInfoLog: null,
        editInfoSaveLog: {
          productUid: [],
          dataStatus: null,
          auditStatus: null,
          sumbitStatus: null,
          detailInfo: null,
        },
        role: 0,
        roles: 0,
        totals: 0,
        editTitle: null,
        logType: 0,
        editStock: null,
        editOpen: false,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 地区信息
        options: [],
        // 默认数字
        activeClass: 0,
        //品牌
        brandOptions: [],
        // 商品类别
        categoryOptions: [],
        majors:[],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multipleS: true,
        multipleX: true,
        multipleH: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 商品信息表格数据
        infoList: [],
        infoListEdit: [],
        // 弹出层标题
        title: "论文资料",
        //查看详细标题
        viewTitle: "",
        // 是否显示弹出层
        open: false,
        //是否显示查看详细弹出层
        viewOpen: false,
        openShare: false,
        //查看详细数据
        showData: [],
        // 用于查询详细的uid
        productViewUid: 0,
        queryParamss: {
          pageNum: 1,
          pageSize: 10,
          type: null,
          productUid: null,
        },
        // 查询参数
        queryParams: {
          tagsUid: [],
          pageNum: 1,
          pageSize: 10,
          productName: null,
          categoryUid: null,
          brandUid: null,
          minBuyNum: "",
          maxBuyNum: "",
          minCostPirce: "",
          maxCostPirce: "",
          minRetailPrice: "",
          maxRetailPrice: "",
          minTradePrice: "",
          maxTradePrice: "",
          dataStatus: null,
          auditStatus: null,
          stockNumber: null,
          categoryUidOne: null,
          categoryUidTwo: null,
          categoryUidThree: null,
        },
        columns: [],
        // 表单参数
        form: {
          productUid:null,
          productNo: "",
          productName: "",
          showPrice: "",
          pages:"",
          numbers:"",
          jifen:"",
          costPrice:"",
          isCategoryRecommend: "0",
          auditStatus: "0",
          showFile:"",
          downloadFile:"",
          isAigcDuplicate:false,
          isTraditionDuplicate:false,
          categoryUid:null,
          majorUids:null,
          tagsUid:null,
          lunwenType:null,
        },
        // 表单校验
        rules: {
          productName: [{
            required: true,
            message: "论文标题不能为空",
            trigger: "blur"
          }],

          categoryUid: [{
            required: true,
            message: "论文分类不能为空",
            trigger: "blur"
          }],

          majorUids: [{
            required: true,
            message: "论文专业不能为空",
            trigger: "blur"
          }],
          productNo: [{
            required: true,
            message: "论文编码不能为空",
            trigger: "blur"
          }],
          pages: [{
            required: true,
            message: "论文页数不能为空",
            trigger: "blur"
          }],
          numbers: [{
            required: true,
            message: "论文字数不能为空",
            trigger: "blur"
          }],

          jifen: [{
            required: true,
            message: "下载积分不能为空",
            trigger: "blur"
          }],
          costPrice: [{
            required: true,
            message: "买断积分不能为空",
            trigger: "blur"
          }],
        },
        logTypeOption: [],
        logProductUid: null,
        testCategoryList: [],
        testGoodsList: [],
        editUnitName: null,

        // 论文类别
        inputLunwWenGroupOptions: [],
        // 论文专业
        inputCategoryOptions: [],
        inputAllCategoryOptions: [],
        selectCategoryUid:0,
        paperTypes:[],

      };
    },
    created() {
      this.getList();
      selectOptions().then(response => {
        this.majors = response.data;
        this.inputAllCategoryOptions = response.data;
        if (this.selectCategoryUid>0){
          this.changeMajor(this.selectCategoryUid);
        }
      });
      firstGroupList().then(respone => {
        this.brandOptions = respone.data;
        this.inputLunwWenGroupOptions = respone.data;
      });
      this.getDicts("product_log").then(response => {
        this.logTypeOption = response.data;
      });
      this.getDicts("paper_app_type").then(response => {
        this.paperTypes = response.data;
      });
      bulidTagsSelect().then(respone => {
        this.tagsOptions = respone.data;
      });
    },
    watch: {
      $route(to, from) {
        //from 从哪来
        //to //到哪去
        let path = from.path;
        if ("/product/data/" == path) {
          //刷新页面
          this.getList();
        } else {
          let index = path.lastIndexOf("/");
          if (index > -1) {
            path = path.substr(0, index);
            if ("/product/data" == path) {
              //刷新页面
              this.queryParams.pageNum = 1
              this.getList();
            }
          }
        }
      }
    },
    methods: {
      submitForm () {

        this.$refs.childs.selectImgs();
        this.$refs.childss.selectImgBanner();

        if (this.form.showFile == null || this.form.showFile == "") {
          this.$message.error("请上传论文展示文件");
          return;
        }
        if (this.form.downloadFile == null || this.form.downloadFile == "") {
          this.$message.error("请上传论文下载文件");
          return;
        }

        this.$refs["form"].validate(valid => {
          if (valid) {

            const productUid = this.form.productUid;
            if (this.form.productUid) {
              //this.form.productUid = productUid;
              updateInfo(this.form).then(respone => {
                this.msgSuccess("修改成功");
                this.colsePro();
              });
            } else {
              addInfo(this.form).then(respone => {
                this.msgSuccess("添加成功");
                this.colsePro();
              });
            }
          }
        });
      },
      backPro () {
        this.openLunwen = false;
      },
      colsePro(){
        this.backPro();
        this.getList();
      },
      changeMajor(row){
        //console.log(" row==>"+row);
        this.inputCategoryOptions = [];
        this.inputAllCategoryOptions.forEach(cate =>{
          if(cate.groupUid == row){
            this.inputCategoryOptions.push(cate);
          }
        });
      },

      changeCategory(row){
        this.categoryOptions = [];
        this.majors.forEach(major =>{
          if (major.groupUid == row){
            this.categoryOptions.push(major);
          }
        });
      },

      /** 查询商品信息列表 */
      getList() {
        this.loading = true;
        if (this.queryParams.majors != null && this.queryParams.majors.length > 0) {
          let uidArray = this.queryParams.majors;
          this.queryParams.majorUidOne = uidArray[0];
          if (uidArray.length > 1) {
            this.queryParams.majorUidTwo = uidArray[1];
          }
          if (uidArray.length > 2) {
            this.queryParams.majorUidThree = uidArray[2];
          }
          //this.queryParams.majorUids = null;
        }
        listInfo(this.queryParams).then(response => {
          this.infoList = response.rows;
          this.total = response.total;
          this.loading = false;
          this.queryParams.majorUidOne = null;
          this.queryParams.majorUidTwo = null;
          this.queryParams.majorUidThree = null;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {};
        this.resetForm("form");
      },
      /** 点击按钮进行刷新 */
      handleQueryStatus(index) {
        this.activeClass = index;
        if (index == 0) {
          this.queryParams.auditStatus = null;
          this.queryParams.dataStatus = null;
          this.queryParams.stockNumber = null;
          this.queryParams.sumbitStatus = null;
        } else if (index == 1) {
          this.queryParams.auditStatus = "1";
          this.queryParams.dataStatus = "1"
          this.queryParams.stockNumber = null;
          this.queryParams.sumbitStatus = null;
        } else if (index == 2) {
          this.queryParams.auditStatus = "1";
          this.queryParams.dataStatus = "1";
          this.queryParams.stockNumber = 0;
          this.queryParams.sumbitStatus = null;
        } else if (index == 3) {
          this.queryParams.auditStatus = "1";
          this.queryParams.dataStatus = "0";
          this.queryParams.stockNumber = null;
          this.queryParams.sumbitStatus = null;
        } else if (index == 4) {
          this.queryParams.auditStatus = "2";
          this.queryParams.sumbitStatus = "1"
          this.queryParams.stockNumber = null;
          this.queryParams.dataStatus = null;

          // this.queryParams.sumbitStatus ="2";
        } else if (index == 5) {
          this.queryParams.auditStatus = "-1";
          this.queryParams.stockNumber = null;
          this.queryParams.sumbitStatus = null;
          this.queryParams.dataStatus = null;

        } else {
          this.queryParams.auditStatus = "0";
          this.queryParams.sumbitStatus = null;
          this.queryParams.stockNumber = null;
          this.queryParams.dataStatus = null;
        }
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.queryParams.tagsUid = [];
        this.queryParams.minBuyNum = "";
        this.queryParams.maxBuyNum = "";
        this.queryParams.minCostPirce = "";
        this.queryParams.maxCostPirce = "";
        this.queryParams.minRetailPrice = "";
        this.queryParams.maxRetailPrice = "";
        this.queryParams.maxTradePrice = "";
        this.queryParams.minTradePrice = "";
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.productUid)
        let bool = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        //this.$router.push("/product/data/");
        this.openLunwen = true;
        this.form.title = "添加论文资料";
        this.form.productUid = null;
        this.form.productNo = "";
        this.form.productName = "";
        this.form.showFile = "";
        this.form.downloadFile = "";
        /*
        this.form.showPrice = "";
        this.form.pages = "";
        this.form.numbers = "";
        this.form.jifen = "";
        this.form.costPrice = "";
        this.form.isCategoryRecommend = "0";
        this.form.auditStatus = "0";
        this.form.showFile = "";
        this.form.downloadFile = "";
        this.form.isAigcDuplicate = false;
        this.form.isTraditionDuplicate = false;
        this.form.categoryUid = null;
        this.form.majorUids = null;
        this.form.tagsUid = null;
        this.form.lunwenType = null;
        */
      },

      /** 修改按钮操作 */
      handleUpdate(row) {
        //const productUid = row.productUid || this.ids[0];
        this.form.productUid = row.productUid;
        //this.$router.push("/product/data/" + productUid);
        this.title = "修改论文资料";
        this.openLunwen = true;
        let $this = this
        if (this.form.productUid) {
          getInfo(this.form.productUid).then(response => {
            $this.form = response.data
            $this.selectCategoryUid = $this.form.categoryUid;
            $this.changeMajor($this.form.categoryUid);
          });
        }
      },

      /** 删除按钮操作 */
      handleDelete(row) {
        const productUids = row.productUid || this.ids;
        this.$confirm('是否确认删除论文名称为"' + row.productName + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delInfo(productUids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
      },
      statusFormat(status) {
        let showStatus = "";
        if (status == "1") {
          showStatus = "上架中";
        } else {
          showStatus = "已下架"
        }
        return showStatus;
      },
      handleSaveLog(dataStatus, auditStatus, sumbitStatus, index, row) {
        if (index == 0) {
          this.editInfoSaveLog.productUids = [];
          this.editInfoSaveLog.auditStatus = auditStatus;
          this.editInfoSaveLog.detailInfo = this.detailInfoLog;
          this.editInfoSaveLog.sumbitStatus = sumbitStatus;
          this.editInfoSaveLog.dataStatus = dataStatus;
          this.editInfoSaveLog.productUids.push(row.productUid);
          editSaveLog(this.editInfoSaveLog).then(response => {
            this.getList();
            this.msgSuccess("操作成功");
          })
        }
      },
      clickLog(row) {
        this.logProductUid = row.productUid;
        this.getLogList();
      },
      getLogList() {
        this.queryParamss.type = "all";
        this.queryParamss.productUid = this.logProductUid;
        getLog(this.queryParamss).then(response => {
          this.logLists = response.rows;
          this.totals = response.total;
          this.openLog = true;
        });
      },
      typeFormat(row, column) {
        return this.selectDictLabel(this.logTypeOption, row.operateType);
      },
      halog() {
        this.logLists = [];
        this.logProductUid = null;
        this.detailInfoLog = null;
        this.productViewUid = null;
        this.editInfoSaveLog.auditStatus = null;
        this.editInfoSaveLog.detailInfo = null;
        this.editInfoSaveLog.sumbitStatus = null;
        this.editInfoSaveLog.dataStatus = null;
        this.editInfoSaveLog.productUids = [];
        this.checkedCities = []
      },
    }
  };
</script>
<style scoped>
  .divShare {
    width: 200px;
    height: 240px;
    display: inline-block;
    background-color: #f5f5f5;
    margin: 5px;
  }

  .shareSpan {
    font-size: 16px;
    font-weight: 600;
    width: 200px;
    margin-bottom: 10px;
    margin-top: 10px
  }

  .divTable {
    padding: 10px;
    background: #fff;
    width: 100%;
    height: 100%;
    border-radius: 6px;
  }

  .row-mbinfo {
    border-radius: 6px;
    width: 100%;
    background-color: #fff;
    padding: 10px;
    margin: 10px 0;
  }

  .app-container {
    background-color: #F7F8FA;
    padding: 20px;
  }

  .formList {
    background-color: #fff;
    padding-top: 10px;
    border-radius: 6px;
  }

  .input-rule {
    width: 232.45px;
  }

  .el-form-item {
    margin-bottom: 10px;
  }

  .el-table {
    /* border-radius: 6px; */
    width: 100%;
    background-color: #fff;
    /* padding: 10px; */
  }

  .button-sku-blue {
    color: #409eff;
    background: #ecf5ff;
    border-color: #b3d8ff;
  }

  .product-header {
    position: absolute;
    top: 0;
    width: 600px;
    padding: 18px;
    background-color: #fff;
    -moz-border-radius: 4px;
    border-radius: 4px;
  }

  .product-div {
    position: relative;
    padding-right: 16px;
    padding-top: 54px;
    border: 1px solid #ebebeb;
    -moz-border-radius: 4px;
    border-radius: 4px;
  }

  .place {
    width: 400px;
  }

  .image-rows {
    height: 100px;
    width: 100px;
    border-radius: 4px;
  }
</style>
